/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.games.ddmonsters.servers.gameserver.network.packets.sending;

import digitaldreamers.libraries.games.servers.networkmanagement.packets.sending.AbSendablePacket;
import digitaldreamers.games.ddmonsters.servers.gameserver.components.PlayerComponent;
import digitaldreamers.games.ddmonsters.servers.gameserver.configurations.Configuration;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 *
 * @author DaoLe
 */
public class SPlayerJoinRoomPacket extends AbSendablePacket {
    private PlayerComponent m_Player;
    
    public SPlayerJoinRoomPacket(PlayerComponent player) {
        m_Player = player;
        mPacketId = Configuration.PLAYER_JOIN_ROOM_PACKET_ID;
    }
    
    @Override
    public void writeData(DataOutputStream DOS) throws IOException {
        DOS.writeInt(mPacketId);
        DOS.writeUTF(m_Player.getPlayerInformation().getLogin());
        //DOS.writeInt(m_Player.getLevel());
        DOS.writeInt(m_Player.getPlayerInformation().getWin());
        DOS.writeInt(m_Player.getPlayerInformation().getLoss());
    }
}
